export const setDefaultHeight = () => {
  let height = document.documentElement.clientHeight;
  let tableHeight = height - 207;
  let setPadding = false;
  let size;
  if (height <= 730) {
    size = Math.floor(tableHeight / 104)
    setPadding = true;
  } else if (height > 730 && height < 910) {
    setPadding = false;
    size = Math.floor(tableHeight / 96)
  } else {
    size = Math.floor(tableHeight / 96)
    setPadding = true;
  }
  return size;
}
export const handlerNull = (boolean, value) => {
  return boolean ? value : '-'
}
export const handlerAvailable = (availble) => {
  const mapColor = {
    0: 'red',
    1: 'green'
  }
  const mapTxt = {
    0: '不可用',
    1: '可用'
  }
  return {
    txt: mapTxt[availble] || '-',
    color: mapColor[availble]
  }
}